<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
  <meta name="description" content="">
  <meta name="author" content="ThemeBucket">
  <link rel="shortcut icon" href="#" type="../image/png">
  <title>Demo</title>
  <!--data table-->
  <link rel="stylesheet" href="../js/data-tables/DT_bootstrap.css" />


</head>
<body class="sticky-header" onload="indexmenu('${oneMenu}','${twoMenu}');">
<%@ include file="../index/index.jsp" %>
<section>
	<div class="main-content">

        <!-- 地址栏-->
		<div class="page-heading">
            <h3>
                	后台管理系统
            </h3>
            <ul class="breadcrumb">
                <li>
                    <a href="#">会员管理</a>
                </li>
                <li class="active">工人管理</li>
            </ul>
        </div>   
		<!--这里是写一些内容的  -->
		<div class="row">
	        <div class="col-sm-12">
	        	<section class="panel">
		        	<div class="panel-body">
		        		<div class="adv-table">
		      				<div id="dynamic-table_wrapper" class="dataTables_wrapper form-inline" role="grid">
		        				<div class="span6">
		        					<h4>工人列表:</h4>
		        					<div class="dataTables_filter" id="dynamic-table_filter">
							        	<input type="text" class="form-control" placeholder="搜索工人" aria-controls="dynamic-table" id="search">
							        	<button  class="btn btn-default" type="button" >搜索</button>			        							
		  							</div>
		       		 			</div>
		       				</div>
		       				<!--表格开始  -->
			       			<table class="display table table-bordered table-striped dataTable table-hover" id="dynamic-table" aria-describedby="dynamic-table_info">
			        			<thead>
						        	<tr role="row">
						        		<th class="sorting" role="columnheader" tabindex="0" aria-controls="dynamic-table" rowspan="1" colspan="1" style="width: 80px;" aria-label="Rendering engine: activate to sort column ascending">工人id</th>						        	
						        		<th class="sorting" role="columnheader" tabindex="0" aria-controls="dynamic-table" rowspan="1" colspan="1" style="width: 100px;" aria-label="Rendering engine: activate to sort column ascending">工人名字</th>	
										<th class="sorting" role="columnheader" tabindex="0" aria-controls="dynamic-table" rowspan="1" colspan="1" style="width: 200px;" aria-label="Rendering engine: activate to sort column ascending">头像</th>						        							        							        		
						        		<th class="sorting" role="columnheader" tabindex="0" aria-controls="dynamic-table" rowspan="1" colspan="1" style="width: 200px;" aria-label="Rendering engine: activate to sort column ascending">手机号</th>
						        		<th class="sorting" role="columnheader" tabindex="0" aria-controls="dynamic-table" rowspan="1" colspan="1" style="width: 80px;" aria-label="Rendering engine: activate to sort column ascending">推荐人手机号</th>						        	
						        		<th class="sorting" role="columnheader" tabindex="0" aria-controls="dynamic-table" rowspan="1" colspan="1" style="width: 100px;" aria-label="Rendering engine: activate to sort column ascending">工作区域</th>						        							        								        		
										<th class="sorting" role="columnheader" tabindex="0" aria-controls="dynamic-table" rowspan="1" colspan="1" style="width: 100px;" aria-label="Rendering engine: activate to sort column ascending">钱包</th>										
										<th class="sorting" role="columnheader" tabindex="0" aria-controls="dynamic-table" rowspan="1" colspan="1" style="width: 100px;" aria-label="Rendering engine: activate to sort column ascending">已交保证金</th>
										<th class="sorting_asc" role="columnheader" tabindex="0" aria-controls="dynamic-table" rowspan="1" colspan="1" style="width: 100px;" aria-label="Rendering engine: activate to sort column ascending" onclick="zhengchangWorker(1)">注册时间</th>
										<th class="sorting" role="columnheader" tabindex="0" aria-controls="dynamic-table" rowspan="1" colspan="1" style="width: 100px;" aria-label="Rendering engine: activate to sort column ascending">状态</th>
										<th class="sorting" role="columnheader" tabindex="0" aria-controls="dynamic-table" rowspan="1" colspan="1" style="width: 100px;" aria-label="Rendering engine: activate to sort column ascending">编辑</th>
						        	</tr>
						        </thead>
							    <tbody role="alert" aria-live="polite" aria-relevant="all">
							    	<c:forEach var="worker" items="${workers}">
							        	<tr class="gradeA even" >
							           		<td class="">${worker.workerId}</td>			           				
								            <td class="">${worker.name}</td>			           				
								            <td class=""><img alt="" src="http://oeilufnx2.bkt.clouddn.com/${worker.headImg}?imageView2/1/w/60/h/60"></td>
							           		<td class="">${worker.phone}</td>			           				
								            <td class="">${worker.referrer}</td>			           				
								            <td class="">${worker.workerSpace}</td>
							           		<td class="">${worker.wallet}</td>			           				
								            <td class="">${worker.credit}</td>	
								            <td class="">${worker.join_dateS}</td>		           												            								            								            
								          	<c:if test="${worker.isDisable==0}">
							            		<td class="">正常</td>
							            	</c:if>
							            	<c:if test="${worker.isDisable==1}">
							            		<td class="">停用</td>
							            	</c:if>	
							            	<c:if test="${worker.isDisable==2}">
							            		<td class="">未激活</td>
							            	</c:if>	
								          	<td class="">
								          		<c:if test="${worker.isDisable==1}">
							            			<button class="btn btn-danger" type="button" onclick="toUpdateworker(${worker.workerId})" disabled="disabled">停用</button>
							            		</c:if>	
							            		<c:if test="${worker.isDisable!=1}">
							            			<button class="btn btn-danger" type="button" onclick="toUpdateworker(${worker.workerId})">停用</button>
							            		</c:if>								      
								          	</td>									            	           									            
								        </tr>							    		
							    	</c:forEach>
							  	</tbody>
							</table>
							<!-- 表格结束 -->
							<!-- 分页开始 -->
						  	<div class="row-fluid">
							  	<div class="span6">
								  	<div class="dataTables_paginate paging_bootstrap pagination">
									  	<ul>									  		
								  			<c:choose>
									  			<c:when test="${page.currentPage==1}">
									  				<li class="prev">
									  					<a class="page-link">← 上一页</a>
									  				</li>
									  			</c:when>
									  			<c:otherwise>
									  				<li class="prev">
									  					<a href="../member/workerS.do?currentPage=${page.currentPage-1}" class="page-link">← 上一页</a>
									  				</li>
									  			</c:otherwise>	 							  			
								  			</c:choose>
						                  <c:forEach begin="1" end="${page.totalPage}" var="p">
						                    	<c:choose>
						                    		<c:when test="${page.currentPage==p}">
						                    			<c:if test="${p==1}">
						                    				<li  class="active page-item"><a class="page-link" href="../member/workerS.do?currentPage=${p}" class="page-link">${p}</a></li> 
						                    				<c:if test="${page.totalPage>1}">
						                    					<li  class="page-item"><a class="page-link" href="../member/workerS.do?currentPage=${p+1}">${p+1}</a></li>
						                    				</c:if>
						                    				<c:if test="${page.totalPage>2}">
						                    					<li  class="page-item"><a class="page-link" href="../member/workerS.do?currentPage=${p+2}">${p+2}</a></li>
						                    				</c:if>
						                    				<c:if test="${page.totalPage>3}">
							                    				<li class="page-item"><a class="page-link" href="#">...</a></li>
							                    			</c:if>
						                    			</c:if>
						                    			<c:if test="${p>1}">                   			                   			
							                    			<c:if test="${p<page.totalPage}">
							                    				<c:if test="${p>2}">
							                    					<li class="page-item"><a class="page-link" href="#">...</a></li>
							                    				</c:if>
							                    				<li class="page-item"><a class="page-link" href="../member/workerS.do?currentPage=${p-1}">${p-1}</a></li>
							                    				<li class="active page-item"><a class="page-link" href="../member/workerS.do?currentPage=${p}" class="current_page">${p}</a></li>
							                    				<c:if test="${page.totalPage>2}">
							                    					<li class="page-item"><a class="page-link" href="../member/workerS.do?currentPage=${p+1}">${p+1}</a></li>
							                    				</c:if>
							                    				<c:if test="${page.totalPage-p>1}">
							                    					<li class="page-item"><a class="page-link" href="#">...</a></li>
							                    				</c:if>
							                    			</c:if>
							                    			<c:if test="${p==page.totalPage}">
							                    				<c:if test="${p>3}">
							                    					<li class="page-item"><a class="page-link" href="#">...</a></li>
							                    				</c:if>
							                    				<c:if test="${p>2}">
							                    					<li class="page-item"><a class="page-link" href="../member/workerS.do?currentPage=${p-2}">${p-2}</a></li>
							                    				</c:if>
							                    				<li class="page-item"><a class="page-link" href="../member/workerS.do?currentPage=${p-1}">${p-1}</a></li>
							                    				<li class="active page-item"><a class="page-link" href="../member/workerS.do?currentPage=${p}" class="current_page">${p}</a></li>
							                    			</c:if>
						                    			</c:if>
						                    		</c:when>
						                    	</c:choose>
						                    </c:forEach>					

								  			<c:choose>
									  			<c:when test="${page.currentPage==page.totalPage}">
									  			
									  					<li class="pre"><a class="page-link">下一页 → </a></li>
									  			
									  			</c:when>
									  			<c:otherwise>
									  			
									  					<li class="pre"><a href="../member/workerS.do?currentPage=${page.currentPage+1}" class="page-link">← 下一页</a>
									  					</li>
									  		
									  			</c:otherwise>	 							  			
								  			</c:choose>
											<li class="page-item"> <a class="page-link">总共${page.totalPage}页</a></li>
									  	</ul>
								  	</div>
								</div>
							</div>
							<!-- 分页结束 -->
						</div>
					</div>
        		</section>
        	</div>
       </div>					
		<!--这里是内容结束  -->
	</div>
</section>


</body>
<script src="../js/member/member.js"></script>
</html>
